home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_actor_scorpian.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  74 lines

  1. # Jones 3D Cog Script
  2. #
  3. # actor_Scorpian.cog
  4. #
  5. # [MDR] [RT]
  6. #
  7. # Special behavior for Scorpians.
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.     message        created
  16.     message        touched
  17.     message        timer
  18.  
  19.     thing        scorpian                    local
  20.     thing        source                        local
  21.  
  22.     flex        crushDamage                    local
  23.  
  24. end
  25.  
  26. # ===================================================================
  27. code
  28.  
  29. # -------------------------------------------------------------------
  30. created:
  31.  
  32.     AISetMode(GetSenderRef(), 0x2000000);        # Set MODE_NOCHASING
  33. #    SetThingMoveSize(GetSenderRef(), 0.05);
  34.  
  35.     return;
  36.  
  37. # -------------------------------------------------------------------
  38. touched:
  39.  
  40.     scorpian = GetSenderRef();
  41.     source = GetSourceRef();
  42.  
  43.     if (source == GetLocalPlayerThing())
  44.     {
  45.         # Ignore touch if Indy's standing still...
  46.         if ( VectorLen(GetThingVel(source)) == 0 )
  47.             return;
  48.  
  49.         # If we weren't just stepped on...
  50.         if (GetThingUserData(scorpian) == 0)
  51.         {
  52.             # Remember what the fiend did!
  53.             SetThingUserData(scorpian, 1);
  54.             SetThingTimer(scorpian, 2.0);
  55.  
  56.             # Apply some damage... 
  57.             crushDamage = GetThingMaxHealth(scorpian) / 2;
  58.             DamageThing(scorpian, crushDamage, 0x8, source);
  59.         }
  60.     }
  61.     return;
  62.  
  63. # -------------------------------------------------------------------
  64. timer:
  65.  
  66.     scorpian = GetSenderRef();
  67.  
  68.     # We're eligible to be stepped on again...how nice
  69.     SetThingUserData(scorpian, 0);
  70.  
  71.     return;
  72.  
  73. end
  74.